package edu.ycu.aladdin.calculator.participle;

import edu.ycu.aladdin.calculator.JniTools;

/**
 * C/C++方式实现的字典前缀树.
 * @author <a href="mailto:wangruihuano@gmail.com">王瑞环</a>
 * @since 1.0
 */
// TODO
public class NativePrefixDictionaryTree extends PrefixDictionaryTree {

    {
        System.load(
                JniTools.getClassPath(NativePrefixDictionaryTree.class) + "calculator-native.so"
        );
    }

    /**
     * 构造字典树
     *
     * @param dicPath 字典路径
     */
    public NativePrefixDictionaryTree(String dicPath) {
        super(dicPath);
    }

    @Override
    protected native void init(String dicPath);

    @Override
    public native int get(String key);
}
